package com.xoa.controller.party;


import com.xoa.model.party.EnHoleBusiness;
import com.xoa.service.party.EnHoleBusinessService;
import com.xoa.util.ToJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 开墙打洞（经营）
 * Created by gsb on 2018/1/6.
 */
@Controller
@RequestMapping("/enHoleBusiness")
public class EnHoleBusinessController {

    @Resource
    private EnHoleBusinessService enHoleBusinessService;

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 下午14:26:51
     * 类介绍  :   新建
     * 构造参数:
     **/
    @RequestMapping(value ="insertSelective")
    @ResponseBody
    public ToJson<EnHoleBusiness> insertSelective(EnHoleBusiness enHoleBusiness , HttpServletRequest request, String gridLocation){
        return enHoleBusinessService.insertSelective(enHoleBusiness, request,gridLocation);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 下午14:28:51
     * 类介绍  :   删除
     * 构造参数:
     **/
    @RequestMapping(value ="deleteByPrimaryKey")
    @ResponseBody
    public ToJson<EnHoleBusiness> deleteByPrimaryKey(Integer bid){
        return enHoleBusinessService.deleteByPrimaryKey(bid);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 下午14:28:51
     * 类介绍  :   修改
     * 构造参数:
     **/
    @RequestMapping(value ="updateByPrimaryKeySelective")
    @ResponseBody
    public ToJson<EnHoleBusiness> updateByPrimaryKeySelective(EnHoleBusiness enHoleBusiness , HttpServletRequest request, String gridLocation) {
        return enHoleBusinessService.updateByPrimaryKeySelective(enHoleBusiness, request,gridLocation);
    }
    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 下午14:30:51
     * 类介绍  :   详情
     * 构造参数:
     **/
    @RequestMapping(value ="selectById")
    @ResponseBody
    public ToJson<EnHoleBusiness> selectById(Integer bid, HttpServletRequest request){
        return enHoleBusinessService.selectById(bid,request);
    }


    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 下午14:35:51
     * 类介绍  :   列表  或 导出 也可条件查询
     * 构造参数:
     *
     */
    @RequestMapping(value ="queryList")
    @ResponseBody
    public ToJson<EnHoleBusiness> queryList(EnHoleBusiness enHoleBusiness, Integer page, Integer pageSize,
                                            boolean useFlag, HttpServletRequest request, HttpServletResponse response, String export){
        return enHoleBusinessService.queryList(enHoleBusiness, page, pageSize, useFlag, request, response, export);

    }

    /**
     *
     * 创建作者:   季佳伟
     * 创建日期:   2018-1-6 下午15:35:51
     * 类介绍  :   导入
     * 构造参数:
     *
     */
    @RequestMapping(value ="importEnHoleBusiness")
    @ResponseBody
    public ToJson<EnHoleBusiness> importEnHoleBusiness(MultipartFile file, HttpServletResponse response,
                                                       HttpServletRequest request, HttpSession session) {
        return enHoleBusinessService.importEnHoleBusiness(file, response, request, session);
    }
}
